<?php

use addons\TfBvex\common\models\AssetsXh;
use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel common\models\common\PaySearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '用户收付款信息';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="row">
    <div class="col-xs-12">
        <div class="box">
            <div class="box-header">
                <h1 class="box-title"><?= $this->title; ?></h1>
            </div>
            <div class="box-body table-responsive">
                <h1><?= Html::encode($this->title) ?></h1>
                <?php // echo $this->render('_search', ['model' => $searchModel]); ?>
                <?= GridView::widget([
                    'dataProvider' => $dataProvider,
                    'filterModel' => $searchModel,
                    'tableOptions' => ['class' => 'table table-hover'],
                    'columns' => [
                        [
                            'class' => 'yii\grid\SerialColumn',
                            'visible' => false,
                        ],
//                        'uid',
                        [
                            'attribute' => 'uid',
                            'label' =>'用户名',
                            'filter' =>FALSE,
                            'value' => function ($model) {
                                return $model->assets->username;
                            },
                        ],
//            'href_alipay:ntext',
//                        [
//                            'attribute' => '支付宝',
//                            'filter' => false,
//                            'format' => 'raw',
//                            'contentOptions' => [
//                                'width' => '100'
//                            ],
//                            'value' => function ($model) {
//                                return Html::a(Html::img($model->href_alipay,[
//                                    'width' => '50px',
//                                    'class' => 'rf-img-md img-bordered-sm',
//                                    ]), $model->href_alipay);
//                            },
//                        ],
//            'href_wechat:ntext',
//                        [
//                            'attribute' => '微信',
//                            'filter' => false,
//                            'format' => 'raw',
//                            'contentOptions' => [
//                                'width' => '100'
//                            ],
//                            'value' => function ($model) {
//                                return Html::a(Html::img($model->href_wechat,[
//                                    'width' => '50px',
//                                    'class' => 'rf-img-md img-bordered-sm',
//                                ]), $model->href_wechat);
////                                return Html::img(unserialize($model->href_wechat),
////                                    [
////                                        'width' => '50px',
////                                        'class' => 'rf-img-md img-bordered-sm',
////                                    ]);
//                            },
//                        ],
//            'kind_name',
                        //'icon',
                        'bank_name',
                        'bank_code',
                        [
                                'attribute' =>'real_name',
                                'filter' =>FALSE,
                                'label'=>'开户人',
                        ],
//                        'nike_name',
//                        'wechat_account',
//                        'alipay_name',
//                        'status',
                        //'created_at',
                        //'updated_at',
                        [
                            'header' => "用户操作",    //列表的标题名称
                            'class' => 'yii\grid\ActionColumn',   //样式
                            'template' => '{view} {statusy} {statusn} {delete}',  //按钮组的成员
                            'buttons' => [
                                'view' => function ($url, $model, $key) {
                                    return Html::a(' 查看', ['view', 'id' => $model->id], [
                                        'class' => 'btn btn-primary btn-sm',
                                        'data-toggle' => 'modal',
                                        'data-target' => '#ajaxModal',
                                    ]);
                                },
                                'statusy' => function ($url, $model, $key) {
                                    if ($model->status != 1) {
                                        return '';
                                    }
                                    return Html::a('通过', ['status', 'id' => $model->id,'status'=>'2'], [
                                        'class' => 'btn btn-success btn-sm',
                                    ]);
                                },
                                'statusn' => function ($url, $model, $key) {
                                    if ($model->status != 1) {
                                        return '';
                                    }
                                    return Html::a('驳回', ['status', 'id' => $model->id,'status'=>'0'], [
                                        'class' => 'btn btn-warning btn-sm',
                                    ]);
                                },
                                'delete' => function ($url, $model, $key) {
                                    return \common\helpers\Html::delete(['delete','id' => $model->id]);
                                }
                            ],
                        ],
//                        ['class' => 'yii\grid\ActionColumn'],
                    ],
                ]); ?>
            </div>
